/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.farent.solutions.plugins.stripes.hyperstripes.core;

import com.farent.solutions.plugins.stripes.hyperstripes.spi.RenderKit;
import java.util.Map;
import javax.servlet.ServletContext;

/**
 *
 * @author user
 */
public interface StripesApplicationContext {

    /**
     * Initialisation call to do bootstrapping
     */
    void init();

    /**
     *
     * @return Get the full URL for the current Stripes application
     * without the servletcontext paths
     */
    String getApplicationUrl();

    /**
     *
     * @return Set the full URL for the current Stripes application
     * without the servletcontext paths
     */
    void setApplicationUrl( String applicationUrl);

    /**
     *
     * @return the ServletContext associated with this application
     */
    ServletContext getServletContext();

    /**
     *
     * @return the registered RenderKits used to generate the View of this application
     */
    Map<String, RenderKit> getRenderKits();

    /**
     * Registers the Supplied RenderKit as used by a ComponentModel in this application
     * @param renderKit
     */
    void addRenderKit( RenderKit renderKit );

    /**
     * Finds the Renderkit in the Renderkit map with the given namespace ID
     * @param namespaceId the namespaceid of the renderkit to find. must not be null
     * @return the renderkit found
     */
    RenderKit getRenderKit( String namespaceId );

    /**
     *
     * @param  Map of componentIds against their path in the Model Tree for easy location
     */
    Map<String, String> getComponentKeyMap();

    String getResourceLocation(String resource);
}